//
//  MYYAuthenticationCell.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/10/24.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYYAuthenticationCell.h"
#import "MYY_Me_Macro.h"

@interface MYYAuthenticationCell()

@end
@implementation MYYAuthenticationCell


+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"MYYAuthenticationCell";
    MYYAuthenticationCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[MYYAuthenticationCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
        cell.selectionStyle          = UITableViewCellSelectionStyleNone;
        cell.backgroundColor         = [UIColor whiteColor];
    }
    
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initCreatUI];
        
    }
    return self;
}

-(void)initCreatUI
{
    [self addSubview:self.titleLabel];
    [self addSubview:self.contentLabel];
    [self addSubview:self.rightLabel];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(0);
        make.left.equalTo(self).with.offset(15);
        make.height.mas_equalTo(MYYMe_cert_H);
        make.width.mas_equalTo(MYYMe_Resume_head_H);
        
    }];
   
    
    [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).with.offset(-15);
        make.centerY.equalTo(self);
        make.width.equalTo(@60);
        make.height.equalTo(@20);
        
    }];
    
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLabel);
        make.height.mas_equalTo(MYYMe_cert_H);
        make.bottom.equalTo(self).with.offset(0);
        
    }];
    
    
}
- (UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = MYYFont(15.0f);
        _titleLabel.numberOfLines = 1;
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.textColor = MYYtitleColor;
        _titleLabel.text = @"实名认证";
    }
    return _titleLabel;
}

- (UILabel *)contentLabel
{
    if (_contentLabel == nil) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = MYYFont(14.0f);
        _contentLabel.numberOfLines = 1;
        _contentLabel.textAlignment = NSTextAlignmentRight;
        _contentLabel.textColor = MYYColorFromRGB(0xa6a6a6);
        _contentLabel.text = @"实名认证成功可参与红包提现";
    }
    return _contentLabel;
}

- (UILabel *)rightLabel
{
    if (_rightLabel == nil) {
        _rightLabel = [[UILabel alloc] init];
        _rightLabel.font = MYYFont(12.0f);
        _rightLabel.textColor = MYYColorFromRGB(0xa6a6a6);
        _rightLabel.text = @"发起认证";
        _rightLabel.layer.cornerRadius = 4.;//边框圆角大小
        _rightLabel.layer.masksToBounds = YES;
        _rightLabel.layer.borderColor =MYYColorFromRGB(0xa6a6a6).CGColor;//边框颜色
        _rightLabel.layer.borderWidth = 1;//边框宽度
        _rightLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _rightLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
